<!DOCTYPE html>





<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.4.1">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.4.1">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.4.1">
  <link rel="mask-icon" href="/images/logo.svg?v=7.4.1" color="#222">

<link rel="stylesheet" href="/css/main.css?v=7.4.1">

<link rel="stylesheet" href="https://fonts.loli.net/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|Monaco:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '7.4.1',
    exturl: false,
    sidebar: {"position":"right","display":"always","offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    },
    sidebarPadding: 40
  };
</script>

  <meta name="description" content="建立ssh 服务 首先是卸载重装一遍ssh服务，自带ssh服务无法建立远程连接。 12sudo apt-get remove openssh-serversudo apt-get install openssh-server  编辑sshd_config文件，修改几处配置才能正常使用用户名/密码的方式连接 1sudo vi /etc/ssh/sshd_config">
<meta name="keywords" content="Python;Antibody;NGS;Bioinformatics">
<meta property="og:type" content="article">
<meta property="og:title" content="WSL配置">
<meta property="og:url" content="https://blingarida.github.io/2019/10/09/WSL配置/index.html">
<meta property="og:site_name" content="TwinkleShowTime">
<meta property="og:description" content="建立ssh 服务 首先是卸载重装一遍ssh服务，自带ssh服务无法建立远程连接。 12sudo apt-get remove openssh-serversudo apt-get install openssh-server  编辑sshd_config文件，修改几处配置才能正常使用用户名/密码的方式连接 1sudo vi /etc/ssh/sshd_config">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://blingarida.github.io/images/1570605454511.png">
<meta property="og:updated_time" content="2019-10-09T07:18:55.157Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="WSL配置">
<meta name="twitter:description" content="建立ssh 服务 首先是卸载重装一遍ssh服务，自带ssh服务无法建立远程连接。 12sudo apt-get remove openssh-serversudo apt-get install openssh-server  编辑sshd_config文件，修改几处配置才能正常使用用户名/密码的方式连接 1sudo vi /etc/ssh/sshd_config">
<meta name="twitter:image" content="https://blingarida.github.io/images/1570605454511.png">
  <link rel="canonical" href="https://blingarida.github.io/2019/10/09/WSL配置/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>WSL配置 | TwinkleShowTime</title>
  








  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">TwinkleShowTime</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">Labourer Can's Work Hour</p>
      
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
      
      
      
        
        <li class="menu-item menu-item-home">
      
    

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-about">
      
    

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-archives">
      
    

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger">
        
          <i class="fa fa-search fa-fw"></i>搜索</a>
      </li>
    
  </ul>

    

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://blingarida.github.io/2019/10/09/WSL配置/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="CanY's Blog">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="TwinkleShowTime">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">WSL配置

          
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              
                
              

              <time title="创建时间：2019-10-09 15:18:55" itemprop="dateCreated datePublished" datetime="2019-10-09T15:18:55+08:00">2019-10-09</time>
            </span>
          

          
          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
              
                <span class="post-meta-item-text">本文字数：</span>
              
              <span>2.1k</span>
            </span>
          
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
              
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              
              <span>2 分钟</span>
            </span>
          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="建立ssh-服务"><a href="#建立ssh-服务" class="headerlink" title="建立ssh 服务"></a>建立ssh 服务</h2><ul>
<li><p>首先是卸载重装一遍ssh服务，自带ssh服务无法建立远程连接。</p>
<figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-<span class="keyword">get</span> <span class="keyword">remove</span> openssh-server</span><br><span class="line">sudo apt-<span class="keyword">get</span> install openssh-server</span><br></pre></td></tr></table></figure>
</li>
<li><p>编辑sshd_config文件，修改几处配置才能正常使用用户名/密码的方式连接</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vi /etc/ssh/sshd_config</span><br></pre></td></tr></table></figure>



</li>
</ul><a id="more"></a>
<p>  修改SSH Server的监听端口，这里修改为<code>23</code>。</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo sed -i &apos;/Port /c Port 23&apos; /etc/ssh/sshd_config</span><br></pre></td></tr></table></figure>



<p>  修改SSH Server的监听地址。</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo sed -i &apos;/ListenAddress 0.0.0.0/c ListenAddress 0.0.0.0&apos; /etc/ssh/sshd_config</span><br></pre></td></tr></table></figure>

<p>  <code>PasswordAuthentication yes # 允许用户名密码方式登录</code></p>
<ul>
<li><p>修改完之后重启ssh服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo service ssh restart</span><br></pre></td></tr></table></figure>

</li>
</ul>
<h2 id="修改用户名"><a href="#修改用户名" class="headerlink" title="修改用户名"></a>修改用户名</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">先创建root密码：sudo -s 进入root</span><br><span class="line">passwd root后输入要创建的root密码</span><br><span class="line"></span><br><span class="line">[cany@0152LO2061907W Fri Sep 20 10:38:03]/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919</span><br><span class="line">$su</span><br><span class="line">Password:</span><br><span class="line">#简单的说就是把cany全都替换成yincan</span><br><span class="line">root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi /etc/passwd</span><br><span class="line">root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi /etc/shadow</span><br><span class="line">root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# vi  /etc/group</span><br><span class="line">root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# mv /home/cany/ /home/yincan</span><br><span class="line">root@0152LO2061907W:/mnt/d/1A/Synthetic_library_design/GermlineGrouping20190919# su -l yincan</span><br></pre></td></tr></table></figure>

<h2 id="在WSL上使用python"><a href="#在WSL上使用python" class="headerlink" title="在WSL上使用python"></a>在WSL上使用python</h2><p><a href="http://www.erogol.com/using-windows-wsl-for-deep-learning-development/" target="_blank" rel="noopener">http://www.erogol.com/using-windows-wsl-for-deep-learning-development/</a></p>
<p><img src="/images/1570605454511.png" alt="1570605454511"></p>
<h3 id="bashrc配置"><a href="#bashrc配置" class="headerlink" title="bashrc配置"></a>bashrc配置</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">alias l=&quot;ll -hrt&quot;</span><br><span class="line">alias L=&quot;l -L&quot;</span><br><span class="line">alias les=&quot;less -S&quot;</span><br><span class="line">alias mkdir=&quot;mkdir -m 755 &quot;</span><br><span class="line">alias tarxzf=&quot;tar -xzvf&quot;</span><br><span class="line">alias tarxjf=&quot;tar -xjvf&quot;</span><br><span class="line">alias tarxf=&quot;tar -xvf&quot;</span><br><span class="line">alias tarcf=&quot;tar -cf&quot;</span><br><span class="line">alias tarczf=&quot;tar -czf&quot;</span><br><span class="line">alias tarcjf=&quot;tar -cjf&quot;</span><br><span class="line">alias rm=&quot;rm -i&quot;</span><br><span class="line">alias grep=&apos;grep --color=auto&apos;</span><br><span class="line">LANG=en_US.utf8</span><br><span class="line">SYSFONT=&quot;latarcyrheb-sun16&quot;</span><br><span class="line">SUPPORTED=&quot;zh_CN.UTF-8:zh_CN:zh&quot;</span><br><span class="line">export LANG</span><br><span class="line">PS1=&quot;\[\e[1;33m\]\u@\t \[\e[1;36m\]\w\[\e[1;35m\]\nBASH---&gt;\[\e[0;37m\] &quot;     #server</span><br><span class="line">alias ipython=&apos;ipython.exe&apos;</span><br><span class="line">alias python=&apos;python.exe -i&apos;</span><br><span class="line">alias pip=&apos;pip.exe&apos;</span><br><span class="line"></span><br><span class="line"># another PS1,my WSL</span><br><span class="line">PS1=&quot;\[\e[1;36m\]\w\[\e[1;35m\] ---&gt; \[\e[0;37m\]&quot;</span><br></pre></td></tr></table></figure>


    </div>

    
    
    
        
      
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>CanY's Blog</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://blingarida.github.io/2019/10/09/WSL配置/" title="WSL配置">https://blingarida.github.io/2019/10/09/WSL配置/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！</li>
</ul>
</div>

      

      <footer class="post-footer">

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
              
                <a href="/2019/10/09/centos6上git clone/" rel="next" title="centOS6上实现git clone">
                  <i class="fa fa-chevron-left"></i> centOS6上实现git clone
                </a>
              
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
              
                <a href="/2019/10/09/Jupyter Notebook实现直接调用R/" rel="prev" title="Jupyter Notebook实现直接调用R">
                  Jupyter Notebook实现直接调用R <i class="fa fa-chevron-right"></i>
                </a>
              
            </div>
          </div>
        
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
        
        
        
        
      

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#建立ssh-服务"><span class="nav-text">建立ssh 服务</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#修改用户名"><span class="nav-text">修改用户名</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#在WSL上使用python"><span class="nav-text">在WSL上使用python</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#bashrc配置"><span class="nav-text">bashrc配置</span></a></li></ol></li></ol></div>
        
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">CanY's Blog</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/BlingArida" title="GitHub &rarr; https://github.com/BlingArida" rel="noopener" target="_blank"><i class="fa fa-fw fa-globe"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="mailto:canyin16@outlook.com" title="E-Mail &rarr; mailto:canyin16@outlook.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-globe"></i>E-Mail</a>
      </span>
    
  </div>
  <div class="cc-license motion-element" itemprop="license">
    
  
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友链：手癌八卦求生小分队
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://silenwang.github.io" title="https://silenwang.github.io" rel="noopener" target="_blank">翻车老先生</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://github.com/EclipseZhao" title="https://github.com/EclipseZhao" rel="noopener" target="_blank">背锅女司机</a>
        </li>
      
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">CanY's Blog</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    
    <span title="站点总字数">22k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    
    <span title="站点阅读时长">20 分钟</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> v7.4.1</div>

        












        
      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js?v=3.1.0"></script>
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="/js/utils.js?v=7.4.1"></script><script src="/js/motion.js?v=7.4.1"></script>
<script src="/js/schemes/muse.js?v=7.4.1"></script>

<script src="/js/next-boot.js?v=7.4.1"></script>



  








  <script src="/js/local-search.js?v=7.4.1"></script>














  

  

  

</body>
</html>
